import 'package:base_lib/app.dart';
import 'package:base_lib/common/bus/ibus.dart';
import 'package:base_lib/router/page_builder.dart';
import 'package:doctor_order_lib/prescription/order_detail_page.dart';
import 'package:doctor_order_lib/prescription/order_list_page.dart';
import 'package:doctor_order_lib/repository/order_http.dart';

class DoctorOrderComponent extends IComponent {
  static const AssetPackageName = 'doctor_order_lib';

  ///处方订单列表
  static const prescriptionOrderPage =
      '$AssetPackageName/prescriptionOrderPage';

  ///处方订单详情
  static const prescriptionOrderDetailPage =
      '$AssetPackageName/prescriptionOrderDetailPage';

  @override
  void doComponentInitConfig() {
    DoctorOrderHttp.createHttpProxy();
  }

  @override
  List<EventBuilder> gePublicEvents() {
    return [];
  }

  @override
  getComponentName() {
    return AssetPackageName;
  }

  @override
  List<PageBuilder> getPages() {
    return [
      PageBuilder(prescriptionOrderPage, (para) {
        return PrescriptionOrderListPage(para);
      }),
      PageBuilder(prescriptionOrderDetailPage, (para) {
        return PrescriptionOrderDetailPage(para);
      })
    ];
  }
}
